import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import java.util.Scanner;

public class Calculator {
    public static void main(String[] args) throws Exception {
    	System.out.print("Enter the string:");
    	Scanner str = new Scanner(System.in);

    	String s = null;
    	s = str.next();

    	if (s.replaceAll("[\\d+-\\\\*/()]","").equals("")) {   	
	        ScriptEngineManager manager = new ScriptEngineManager();
	        ScriptEngine engine = manager.getEngineByName("JavaScript");
	        engine.eval("function t() {return " + s + ";}");
	        Invocable invocable = (Invocable) engine;
	        Object o = invocable.invokeFunction("t");
	        System.out.println(o);
    	}
    }
}
    	
    	
    
